<template>
	<view class="">
		<view class="top">
			<u-search shape="square"></u-search>
		</view>
		<!-- 商品列表区域 -->
		<view class="box" v-for="(item,index) in list">
			<view class="left">
				<image :src="$baseUrl + item.img" mode=""></image>
			</view>
			<view class="right">
				<view class="" style="font-size: 20rpx;">{{item.goodsname }}</view>
				<view class="" style="color: red;font-size: 50rpx;">￥{{item.price}}
					<text class="" style="color: red;font-size: 30rpx;">￥{{item.market_price}}</text>
				</view>

				<view class="" style="color: gray;font-size: 30rpx;">3656评论</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataBuffer: false,
				list: []
			}
		},
		onLoad(e) {
			console.log(e);
			this.$http({
				url: '/api/getgoodlist',
				data: {
					cateid: e.id,
					type: 1
				}
			}).then((res) => {
				console.log(res);
				console.log(res.data.list.goodData);
				this.list = res.data.list.goodData
			})
		}

	}
</script>

<style lang="scss">
	.box image {
		width: 350rpx;
		height: 350rpx;
	}

	.box {
		display: flex;
	}

	.right {
		margin-top: 50rpx;
		text-align: center;
		line-height: 80rpx;

	}
</style>